package com.heima.article.controller.v1;

import com.alibaba.fastjson.JSON;
import com.heima.article.service.CollectionService;
import com.heima.common.redis.BehaviorConstants;
import com.heima.model.article.dto.CollectionBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.utils.thread.ApThreadLocalUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/api/v1/collection_behavior")
public class CollectionController {
    @Autowired
    private CollectionService collectionService;
    /**
     * 收藏功能
     * @param dto
     * @return
     */
    @PostMapping()
    public ResponseResult Collection(@RequestBody CollectionBehaviorDto dto) {

        return   collectionService.Collection(dto);
    }
}
